ocaml/xenctrl: Make failwith_xc() thread safe
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Jan 2015 17:55:32 +0000 (17:55 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 2 Feb 2015 14:42:09 +0000 (14:42 +0000)
commitc8945d51613450c19e0898b1b3056c90f4929179
tree57934c5d46319e2401658c9fd7d56de1563335c1
parentdc9e2d7c1ea4fae09b496978e9ab01d2531cd7ee
ocaml/xenctrl: Make failwith_xc() thread safe

The static error_str[] buffer is not thread-safe, and 1024 bytes is
unreasonably large.  Reduce to 256 bytes (which is still much larger than any
current use), and move it to being a stack variable.

Also, propagate the Noreturn attribute from caml_raise_with_string().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Dave Scott <Dave.Scott@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
tools/ocaml/libs/xc/xenctrl_stubs.c